var loadingNodes = $("[preload]");
loadingNodes.each(function(index, node){
	var totalWidth = $(node).width();
	totalWidth += parseInt($(node).css("padding-left"));
	totalWidth += parseInt($(node).css("padding-right"));

	var totalHeight = $(node).height();
	totalHeight += parseInt($(node).css("padding-top"));
	totalHeight += parseInt($(node).css("padding-bottom"));
	var str = "<div class='loading-js' style='position:absolute;left:0px;top:0px;width:" + totalWidth +"px;height:" + totalHeight + "px;'>";
	str += "<div style='background-color:black;opacity:0.75;width:100%;height:100%;'></div>";
	str += "<div style='color:white;width:30px;height:30px;font-size:30px;line-height:30px;position:absolute;left:50%;top:50%;margin-left:-15px;margin-top:-15px;'>";
	str += '<i class="fa fa-spinner fa-pulse"></i>';
	str += '</div>';
	str += "</div>";
	$(node).css("position", "relative");
	$(node).append(str);
});

function removeLoading(node)
{
	$(node).find(".loading-js").remove();
}